<?php
//Open images directory

$dir = opendir("css/themes");
if(!$dir){
	$arr = array("result"=>"failed");
	echo json_encode($arr);
}
else{
	$themeArr = array();
	$themeArrIndex = 0;
	//List files in images directory
	while (($file = readdir($dir)) !== false)
	{
		if($file != "." && $file != ".." && $file!= "Default"){
			$themeArr[$themeArrIndex] = $file;
			$themeArrIndex ++;
		}
	}
	$arr = array("result"=>"success","content"=>$themeArr);
	echo json_encode($arr);
}
//Resets the directory stream
rewinddir($dir);

//Code to check for changes

closedir($dir);
?> 